```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java格式化类深度解析</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .code-block {
            background-color: #2d3748;
            border-radius: 0.5rem;
            padding: 1.25rem;
            color: #e2e8f0;
            font-family: 'Courier New', Courier, monospace;
            position: relative;
        }
        .code-copy {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            color: #a0aec0;
            cursor: pointer;
            transition: all 0.2s;
        }
        .code-copy:hover {
            color: #ffffff;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .first-letter {
            font-size: 3.5rem;
            line-height: 1;
            float: left;
            margin-right: 0.5rem;
            margin-top: 0.25rem;
            font-weight: bold;
            color: #4a5568;
            font-family: 'Noto Serif SC', serif;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:py-32">
        <div class="container mx-auto max-w-4xl text-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-6 font-serif">Java格式化类深度解析</h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">掌握DateFormat、NumberFormat与MessageFormat的艺术</p>
            <div class="flex justify-center space-x-4">
                <a href="#overview" class="bg-white text-indigo-700 px-6 py-3 rounded-full font-medium hover:bg-gray-100 transition duration-300">开始探索</a>
                <a href="#code-example" class="border-2 border-white text-white px-6 py-3 rounded-full font-medium hover:bg-white hover:text-indigo-700 transition duration-300">查看示例</a>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <div class="container mx-auto max-w-6xl px-4 py-12 md:py-20">
        <!-- Overview Section -->
        <section id="overview" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="w-12 h-1 bg-indigo-600 mr-4"></div>
                <h2 class="text-2xl md:text-3xl font-bold text-gray-800">格式化类概述</h2>
            </div>
            
            <div class="flex flex-col md:flex-row gap-8 mb-12">
                <div class="md:w-2/3">
                    <div class="bg-white p-8 rounded-xl shadow-lg">
                        <span class="first-letter">格</span>
                        <p class="text-lg leading-relaxed mb-6">格式化类及其子类是处理日期、数字和文本格式化的重要工具之一。它们提供了丰富的功能，使得我们可以轻松地对数据进行格式化和解析，满足不同场景下的需求。</p>
                        
                        <p class="text-lg leading-relaxed mb-6">Java 中的格式化类位于 <code class="bg-gray-100 px-2 py-1 rounded">java.text</code> 包中，其中包括了 <code class="bg-gray-100 px-2 py-1 rounded">Format</code> 类及其多个子类，如 <code class="bg-gray-100 px-2 py-1 rounded">DateFormat</code>、<code class="bg-gray-100 px-2 py-1 rounded">NumberFormat</code>、<code class="bg-gray-100 px-2 py-1 rounded">MessageFormat</code> 等。这些类提供了通用的格式化和解析方法，可以处理日期、数字、文本等不同类型的数据。</p>
                    </div>
                </div>
                
                <div class="md:w-1/3">
                    <div class="bg-white p-6 rounded-xl shadow-lg h-full">
                        <h3 class="text-xl font-bold mb-4 text-indigo-600 flex items-center">
                            <i class="fas fa-info-circle mr-2"></i> 核心格式化类
                        </h3>
                        <ul class="space-y-3">
                            <li class="flex items-start">
                                <i class="fas fa-hashtag text-indigo-500 mt-1 mr-2"></i>
                                <span>NumberFormat - 数字格式化</span>
                            </li>
                            <li class="flex items-start">
                                <i class="far fa-calendar-alt text-indigo-500 mt-1 mr-2"></i>
                                <span>DateFormat - 日期时间格式化</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-comment-alt text-indigo-500 mt-1 mr-2"></i>
                                <span>MessageFormat - 消息文本格式化</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            
            <!-- Visualization -->
            <div class="bg-white p-6 rounded-xl shadow-lg mb-12">
                <h3 class="text-xl font-bold mb-6 text-gray-800 flex items-center">
                    <i class="fas fa-project-diagram mr-2 text-indigo-600"></i> 格式化类关系图
                </h3>
                <div class="mermaid">
                    classDiagram
                        Format <|-- NumberFormat
                        Format <|-- DateFormat
                        Format <|-- MessageFormat
                        NumberFormat <|-- DecimalFormat
                        NumberFormat <|-- ChoiceFormat
                        DateFormat <|-- SimpleDateFormat
                        
                        class Format {
                            <<abstract>>
                            +format(Object obj): String
                            +parse(String source): Object
                        }
                        
                        class NumberFormat {
                            <<abstract>>
                            +getNumberInstance(): NumberFormat
                            +getCurrencyInstance(): NumberFormat
                        }
                        
                        class DateFormat {
                            <<abstract>>
                            +getDateInstance(): DateFormat
                            +getTimeInstance(): DateFormat
                        }
                </div>
            </div>
        </section>
        
        <!-- NumberFormat Section -->
        <section id="numberformat" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="w-12 h-1 bg-indigo-600 mr-4"></div>
                <h2 class="text-2xl md:text-3xl font-bold text-gray-800">NumberFormat 类</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-8">
                <div class="bg-white p-8 rounded-xl shadow-lg card-hover transition duration-300">
                    <h3 class="text-xl font-bold mb-4 text-indigo-600 flex items-center">
                        <i class="fas fa-hashtag mr-2"></i> 数字格式化
                    </h3>
                    <p class="mb-4"><code class="bg-gray-100 px-2 py-1 rounded">NumberFormat</code> 类用于格式化和解析数字，包括整数、浮点数等。它提供了各种格式化风格和模式，可以满足不同语言和文化习惯下的数字显示需求。</p>
                    <p>常见的子类包括 <code class="bg-gray-100 px-2 py-1 rounded">DecimalFormat</code> 和 <code class="bg-gray-100 px-2 py-1 rounded">ChoiceFormat</code>。</p>
                </div>
                
                <div class="bg-white p-8 rounded-xl shadow-lg card-hover transition duration-300">
                    <h3 class="text-xl font-bold mb-4 text-indigo-600 flex items-center">
                        <i class="fas fa-globe mr-2"></i> 国际化支持
                    </h3>
                    <p><code class="bg-gray-100 px-2 py-1 rounded">NumberFormat</code> 通过 <code class="bg-gray-100 px-2 py-1 rounded">Locale</code> 支持国际化，可以自动适应不同地区的数字格式：</p>
                    <ul class="mt-3 space-y-2">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>千位分隔符</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>货币符号</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>小数点格式</span>
                        </li>
                    </ul>
                </div>
            </div>
        </section>
        
        <!-- DateFormat Section -->
        <section id="dateformat" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="w-12 h-1 bg-indigo-600 mr-4"></div>
                <h2 class="text-2xl md:text-3xl font-bold text-gray-800">DateFormat 类</h2>
            </div>
            
            <div class="bg-white p-8 rounded-xl shadow-lg mb-8">
                <h3 class="text-xl font-bold mb-4 text-indigo-600 flex items-center">
                    <i class="far fa-calendar-alt mr-2"></i> 日期时间格式化
                </h3>
                <p class="mb-6"><code class="bg-gray-100 px-2 py-1 rounded">DateFormat</code> 类用于格式化和解析日期和时间。它提供了各种预定义的日期和时间格式样式，同时也支持自定义格式。<code class="bg-gray-100 px-2 py-1 rounded">DateFormat</code> 类的子类包括 <code class="bg-gray-100 px-2 py-1 rounded">SimpleDateFormat</code>、<code class="bg-gray-100 px-2 py-1 rounded">DateFormatSymbols</code> 等。</p>
                
                <div class="grid md:grid-cols-3 gap-6">
                    <div class="border-l-4 border-indigo-500 pl-4">
                        <h4 class="font-bold mb-2">预定义样式</h4>
                        <ul class="space-y-1 text-sm">
                            <li>FULL - 完整格式</li>
                            <li>LONG - 长格式</li>
                            <li>MEDIUM - 中等格式</li>
                            <li>SHORT - 短格式</li>
                        </ul>
                    </div>
                    
                    <div class="border-l-4 border-indigo-500 pl-4">
                        <h4 class="font-bold mb-2">格式化类型</h4>
                        <ul class="space-y-1 text-sm">
                            <li>日期格式化</li>
                            <li>时间格式化</li>
                            <li>日期时间格式化</li>
                        </ul>
                    </div>
                    
                    <div class="border-l-4 border-indigo-500 pl-4">
                        <h4 class="font-bold mb-2">主要方法</h4>
                        <ul class="space-y-1 text-sm">
                            <li>format(Date date)</li>
                            <li>parse(String source)</li>
                            <li>getDateInstance()</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- MessageFormat Section -->
        <section id="messageformat" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="w-12 h-1 bg-indigo-600 mr-4"></div>
                <h2 class="text-2xl md:text-3xl font-bold text-gray-800">MessageFormat 类</h2>
            </div>
            
            <div class="bg-white p-8 rounded-xl shadow-lg mb-8">
                <h3 class="text-xl font-bold mb-4 text-indigo-600 flex items-center">
                    <i class="fas fa-comment-alt mr-2"></i> 消息文本格式化
                </h3>
                <p class="mb-6"><code class="bg-gray-100 px-2 py-1 rounded">MessageFormat</code> 类用于格式化带占位符的消息文本。它允许我们将参数插入到消息文本中，并根据指定的格式进行格式化。<code class="bg-gray-100 px-2 py-1 rounded">MessageFormat</code> 类的主要方法是 <code class="bg-gray-100 px-2 py-1 rounded">format()</code> 和 <code class="bg-gray-100 px-2 py-1 rounded">parse()</code>。</p>
                
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h4 class="font-bold mb-3 text-gray-700">占位符语法</h4>
                        <div class="code-block">
                            <button class="code-copy" title="复制代码">
                                <i class="far fa-copy"></i>
                            </button>
                            <pre><code>{argument_index[,format_type][,format_style]}</code></pre>
                        </div>
                        <p class="mt-3 text-sm text-gray-600">其中format_type可以是number, date, time, choice</p>
                    </div>
                    
                    <div>
                        <h4 class="font-bold mb-3 text-gray-700">示例</h4>
                        <div class="code-block">
                            <button class="code-copy" title="复制代码">
                                <i class="far fa-copy"></i>
                            </button>
                            <pre><code>String pattern = "At {1,time} on {1,date}, there was {2}.";
MessageFormat.format(pattern, new Date(), "a disk failure");</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- Code Example Section -->
        <section id="code-example" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="w-12 h-1 bg-indigo-600 mr-4"></div>
                <h2 class="text-2xl md:text-3xl font-bold text-gray-800">使用示例</h2>
            </div>
            
            <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                <div class="p-6 bg-gray-800 text-white flex justify-between items-center">
                    <h3 class="text-lg font-bold flex items-center">
                        <i class="fas fa-code mr-2"></i> 格式化示例代码
                    </h3>
                    <button class="code-copy" title="复制全部代码">
                        <i class="far fa-copy"></i> 复制全部
                    </button>
                </div>
                <div class="code-block rounded-t-none">
                    <button class="code-copy" title="复制代码">
                        <i class="far fa-copy"></i>
                    </button>
                    <pre><code>import java.text.NumberFormat;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

public class FormatDemo {
    public static void main(String[] args) {
        // 格式化数字
        double number = 12345.6789;
        NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US);
        String formattedNumber = numberFormat.format(number);
        System.out.println("格式化后的数字：" + formattedNumber);

        // 格式化日期
        Date date = new Date();
        DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, Locale.CHINA);
        String formattedDate = dateFormat.format(date);
        System.out.println("格式化后的日期：" + formattedDate);
    }
}</code></pre>
                </div>
            </div>
        </section>
        
        <!-- Best Practices Section -->
        <section id="best-practices" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="w-12 h-1 bg-indigo-600 mr-4"></div>
                <h2 class="text-2xl md:text-3xl font-bold text-gray-800">最佳实践与注意事项</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white p-8 rounded-xl shadow-lg card-hover transition duration-300">
                    <h3 class="text-xl font-bold mb-4 text-indigo-600 flex items-center">
                        <i class="fas fa-shield-alt mr-2"></i> 线程安全
                    </h3>
                    <p>在使用格式化类时，应注意线程安全性。通常情况下，这些类都是线程安全的，但在多线程环境中使用时需要注意同步问题。</p>
                    <div class="mt-4 p-4 bg-yellow-50 border-l-4 border-yellow-400">
                        <p class="text-yellow-700"><i class="fas fa-exclamation-triangle mr-2"></i> <code class="bg-yellow-100 px-1 py-0.5 rounded">SimpleDateFormat</code> 不是线程安全的，多线程环境下应避免共享实例。</p>
                    </div>
                </div>
                
                <div class="bg-white p-8 rounded-xl shadow-lg card-hover transition duration-300">
                    <h3 class="text-xl font-bold mb-4 text-indigo-600 flex items-center">
                        <i class="fas fa-globe-americas mr-2"></i> 国际化考虑
                    </h3>
                    <p>在进行日期和数字格式化时，应考虑不同地区和语言的习惯和格式要求，选择合适的 <code class="bg-gray-100 px-2 py-1 rounded">Locale</code> 进行格式化。</p>
                    <div class="mt-4 flex items-center space-x-4">
                        <div class="text-center">
                            <div class="text-sm font-medium">美国格式</div>
                            <div class="text-gray-500">12,345.679</div>
                        </div>
                        <div class="text-center">
                            <div class="text-sm font-medium">德国格式</div>
                            <div class="text-gray-500">12.345,679</div>
                        </div>
                        <div class="text-center">
                            <div class="text-sm font-medium">法国格式</div>
                            <div class="text-gray-500">12 345,679</div>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="mt-8 bg-white p-8 rounded-xl shadow-lg">
                <h3 class="text-xl font-bold mb-4 text-indigo-600 flex items-center">
                    <i class="fas fa-magic mr-2"></i> 自定义格式化
                </h3>
                <p class="mb-6">除了使用预定义的格式样式外，我们还可以通过 <code class="bg-gray-100 px-2 py-1 rounded">SimpleDateFormat</code> 类和 <code class="bg-gray-100 px-2 py-1 rounded">DecimalFormat</code> 类来自定义日期和数字的格式。通过指定格式模式和模式字符，可以实现灵活的自定义格式化。</p>
                
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h4 class="font-bold mb-3 text-gray-700">日期模式示例</h4>
                        <div class="code-block">
                            <button class="code-copy" title="复制代码">
                                <i class="far fa-copy"></i>
                            </button>
                            <pre><code>SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String formatted = sdf.format(new Date());
// 输出: 2023-05-15 14:30:45</code></pre>
                        </div>
                    </div>
                    
                    <div>
                        <h4 class="font-bold mb-3 text-gray-700">数字模式示例</h4>
                        <div class="code-block">
                            <button class="code-copy" title="复制代码">
                                <i class="far fa-copy"></i>
                            </button>
                            <pre><code>DecimalFormat df = new DecimalFormat("#,##0.00");
String formatted = df.format(12345.6789);
// 输出: 12,345.68</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- Summary Section -->
        <section class="bg-indigo-50 p-8 rounded-xl">
            <div class="text-center max-w-3xl mx-auto">
                <h2 class="text-2xl md:text-3xl font-bold text-indigo-800 mb-4">掌握Java格式化类</h2>
                <p class="text-lg text-indigo-700 mb-6">Java格式化类提供了强大而灵活的功能来处理日期、数字和消息文本的格式化和解析。通过正确使用这些类，可以创建符合国际标准的应用程序，提升用户体验。</p>
                <div class="flex justify-center space-x-4">
                    <a href="#overview" class="bg-indigo-600 text-white px-6 py-3 rounded-full font-medium hover:bg-indigo-700 transition duration-300">重新回顾</a>
                    <a href="#code-example" class="border-2 border-indigo-600 text-indigo-600 px-6 py-3 rounded-full font-medium hover:bg-white transition duration-300">查看代码</a>
                </div>
            </div>
        </section>
    </div>
    
    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-12">
        <div class="container mx-auto px-4">
            <div class="text-center">
                <h3 class="text-xl font-bold mb-2">技术小馆</h3>
                <a href="http://www.yuque.com/jtostring" class="text-gray-400 hover:text-white transition duration-300">http://www.yuque.com/jtostring</a>
            </div>
            <div class="mt-8 pt-8 border-t border-gray-800 text-center text-gray-500 text-sm">
                &copy; 2023 技术小馆. 保留所有权利.
            </div>
        </div>
    </footer>
    
    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            fontFamily: "'Noto Sans SC', sans-serif"
        });
        
        // Copy code functionality
        document.querySelectorAll('.code-copy').forEach(button => {
            button.addEventListener('click', function() {
                const codeBlock = this.parentElement.querySelector('code');
                const range = document.createRange();
                range.selectNode(codeBlock);
                window.getSelection().removeAllRanges();
                window.getSelection().addRange(range);
                document.execCommand('copy');
                window.getSelection().removeAllRanges();
                
                // Show feedback
                const originalTitle = this.title;
                this.innerHTML = '<i class="fas fa-check"></i>';
                this.title = '已复制';
                setTimeout(() => {
                    this.innerHTML = '<i class="far fa-copy"></i>';
                    this.title = originalTitle;
                }, 2000);
            });
        });
    </script>
</body>
</html>
```